package com.share.util;

public class DynamicDataSourceHolder {
	/**
     * HOLDERS:维护当前线程
     */
	private static final ThreadLocal<DynamicDataSourceType> HOLDERS = new ThreadLocal<DynamicDataSourceType>();
	
	public static void setDataSourceType(DynamicDataSourceType dataSourceType){
		if (dataSourceType == null) {
			HOLDERS.set(DynamicDataSourceType.COMM_MU);
		}else {
			HOLDERS.set(dataSourceType);
		}
	}
	
	public static DynamicDataSourceType getDataSourceType(){
		return HOLDERS.get();
	}
	
}
